<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>location和history</title>
		<script>
			function gotoBaidu(){
				alert("host:"+window.location.host);
				alert("hostname:"+window.location.hostname);
				alert("herf="+window.location.href);
				
				window.location.replace("https://www.baidu.com");
			}
		</script>
	</head>
	<body>
		<a href="shopping.html">shopping</a>
		<a href="javascript:void(0)" onclick="window.alert('这个是链接点击事件');">链接事件</a>
		<a href="#" onclick="window.alert('这个是链接点击事件');">链接事件</a>
		<button type="button" onclick="window.history.back();">后退</button>
		<button type="button" onclick="window.location.reload();">刷新</button>
		
		<button type="button" onclick="gotoBaidu();">去baidu</button>
	</body>
</html>